package org.lingshi.controller;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class BaseController {
    Map<String,String> MIMES = new HashMap();
    {
        MIMES.put(".jpg","image/jpeg");
		MIMES.put(".jpeg","image/jpeg");
        MIMES.put(".gif","image/gif");
        MIMES.put(".png","image/png");
    }
    protected String getMIME(String extName){
        return MIMES.get( extName );
    }

    /*
    * 这个方法的用途:
    * 1. 将一个图片文件输出到页面。
    * 2. 并展示出来。
    */
    protected void outFile(
        HttpServletResponse resp,
        String dir, String image )
        throws IOException {
       
    }

    protected R checkRepeat(Exception e, String errInfo,
        String msg){
        return null;
    }

}
